package org.taobao.ibatiside.ui.binding;

import org.eclipse.core.databinding.conversion.IConverter;
import org.eclipse.core.resources.IResource;

public class ResourceIsReadyConverter implements IConverter {

	@Override
	public Object getFromType() {
		return IResource.class;
	}

	@Override
	public Object getToType() {
		return Boolean.class;
	}

	@Override
	public Object convert(Object fromObject) {
		return fromObject != null && ((IResource)fromObject).isAccessible();
	}

}
